<template>
  <div class="phone-container">
    <!-- 手机外壳 -->
    <div class="phone-frame">
      <!-- 音量键 -->
      <div class="volume-buttons">
        <div class="volume-up"></div>
        <div class="volume-down"></div>
      </div>

      <!-- 开机键 -->
      <div class="power-button"></div>

      <!-- 静音开关 -->
      <div class="mute-switch"></div>

      <!-- 手机屏幕内容 -->
      <div class="phone-screen">
        <div class="notice-container">
          <!-- 顶部导航栏 -->
          <van-nav-bar title="自助开单" left-arrow fixed placeholder @click-left="goBack" class="custom-nav">
            <template #right>
              <van-icon name="ellipsis" size="20" />
              <van-icon name="question-o" size="20" style="margin-left: 12px" />
            </template>
          </van-nav-bar>

          <!-- 主要内容区域 -->
          <div class="content">
            <!-- 标题 -->
            <div class="page-title">自助开单须知</div>

            <!-- 须知内容 -->
            <div class="notice-content">
              <div class="notice-item">
                <span class="item-number">1、</span>
                <span class="item-text">
                  便民门诊就诊须知先挂号，再就诊，实名就诊，病员信息与就诊卡不符，不能开药开单。
                </span>
              </div>

              <div class="notice-item">
                <span class="item-number">2、</span>
                <span class="item-text">
                  便民门诊，为大临床医疗常见用药，如感冒药，胃药等，常用药品管理，
                  <span
                    class="highlight">每日门诊不超过3盒以上药品：（1）血液制品如人血白蛋白，抗蛇毒血清，破伤风抗毒素等；（2）破伤风疫苗球蛋白，人乙肝免疫球蛋白等；（3）毒麻药品，精神药品等；（4）各类胰岛素液用药等，如需开上述药品，请到相应专科就诊由专科医生评估后开具。</span>
                </span>
              </div>

              <div class="notice-item">
                <span class="item-number">3、</span>
                <span class="item-text">
                  根据《处方管理办法》，处方开具当日有效；处方一般不得超过7日用量；对于某些慢性病，老年病或特殊情况，处方用量可适当延长，但医师应当注明理由。便民门诊不做病情、检验、检查结果的解释，不开具诊断证明书。
                </span>
              </div>

              <div class="notice-item">
                <span class="item-number">4、</span>
                <span class="item-text">
                  代开药须持患者本人和代开药人身份证件，并出示患者过往专科开药病历。
                </span>
              </div>

              <div class="notice-item">
                <span class="item-number">5、</span>
                <span class="item-text">
                  便民门诊仅开具以体检为目的的常规临床医疗化验令单项目，如血、尿、便常规，乙肝两对半，血生化，心电图、B超、X片、CT等，其他专科大型检查请到专科开具。
                </span>
              </div>

              <div class="notice-item">
                <span class="item-number">6、</span>
                <span class="item-text">
                  工作时间：周一到周五：07：45-12：00，12：45-16：30，8周六/周日：08:00-12:00；节假日以医院公告为准。
                </span>
              </div>

              <!-- 注意事项 -->
              <div class="warning-notice">
                <div class="warning-text">
                  注意：孕妇请在执业中医师指导下使用；初诊患者和非我院住院病史患者都不建议在便民门诊就诊医开药，以免耽误病情。
                </div>
              </div>
            </div>

            <!-- 底部按钮 -->
            <div class="bottom-action">
              <van-button type="primary" block round @click="confirmAndProceed" class="confirm-btn">
                我已阅读并同意须知
              </van-button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { showToast } from 'vant'

const router = useRouter()

// 返回上一页
const goBack = () => {
  router.back()
}

// 确认并继续
const confirmAndProceed = () => {
  showToast('已确认须知，请选择院区')
  router.push('/hospital-list')
}
</script>

<style scoped>
/* 手机容器 */
.phone-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* 手机外壳 */
.phone-frame {
  position: relative;
  width: 375px;
  height: 812px;
  background: #1a1a1a;
  border-radius: 40px;
  padding: 8px;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 20px 40px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px #3a3a3a;
}

/* 音量键 */
.volume-buttons {
  position: absolute;
  left: -2px;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.volume-up,
.volume-down {
  width: 4px;
  height: 30px;
  background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 开机键 */
.power-button {
  position: absolute;
  right: -2px;
  top: 120px;
  width: 4px;
  height: 60px;
  background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 静音开关 */
.mute-switch {
  position: absolute;
  left: -2px;
  top: 200px;
  width: 4px;
  height: 25px;
  background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 手机屏幕 */
.phone-screen {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
}

.notice-container {
  min-height: 100vh;
  background-color: #f8f9fa;
}

.custom-nav {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

:deep(.van-nav-bar__title) {
  color: white;
  font-weight: 500;
}

:deep(.van-nav-bar__left .van-icon) {
  color: white;
}

:deep(.van-nav-bar__right .van-icon) {
  color: white;
}

.content {
  padding: 16px;
  padding-bottom: 100px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-left: 4px;
}

.notice-content {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.notice-item {
  display: flex;
  margin-bottom: 16px;
  line-height: 1.6;
}

.notice-item:last-child {
  margin-bottom: 0;
}

.item-number {
  color: #333;
  font-weight: 500;
  min-width: 20px;
  font-size: 14px;
}

.item-text {
  flex: 1;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
}

.highlight {
  color: #e74c3c;
  font-weight: 500;
}

.warning-notice {
  margin-top: 20px;
  padding: 12px;
  background: #fff5f5;
  border-left: 4px solid #e74c3c;
  border-radius: 4px;
}

.warning-text {
  color: #e74c3c;
  font-size: 13px;
  line-height: 1.5;
}

.bottom-action {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: white;
  border-top: 1px solid #f0f0f0;
}

.confirm-btn {
  height: 48px;
  font-size: 16px;
  font-weight: 500;
}

:deep(.van-button--primary) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

/* 手机外壳响应式 */
@media (max-width: 420px) {
  .phone-frame {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    padding: 0;
  }

  .phone-screen {
    border-radius: 0;
  }

  .volume-buttons,
  .power-button,
  .mute-switch {
    display: none;
  }
}
</style>
